import { axios } from '@/utils/request'

export function fetchList (params) {
  return axios({
    url: '/cmsCategory/page',
    method: 'GET',
    params: {
      ...params
    }
  })
}
export function getObj (id) {
  return axios({
    url: `/cmsCategory/${id}`,
    method: 'GET'
  })
}
export function save (params) {
  return axios({
    url: '/cmsCategory/save',
    method: 'POST',
    data: params
  })
}
export function update (params) {
  return axios({
    url: '/cmsCategory/update',
    method: 'PUT',
    data: params
  })
}
// 类别下拉框
export function dropdownByType () {
  return axios({
    url: `/cmsCategory/dropdownByType`,
    method: 'GET'
  })
}
// 上级目录
export function fetchTree () {
  return axios({
    url: '/cmsCategory/select',
    method: 'GET'
  })
}
// 查询所有
export function treeList () {
  return axios({
    url: '/cmsCategory/tree',
    method: 'GET'
  })
}
